package com.hzhr.iot.device.service;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.CygQuery;
import com.hzhr.iot.core.annotation.CygQuerys;
import com.hzhr.iot.core.annotation.CygService;
import com.hzhr.iot.core.constant.AccessModeEnum;
import com.hzhr.iot.core.constant.CommonOptions;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.core.util.HzhrDateUtil;
import com.hzhr.iot.core.util.HzhrJsonUtil;
import com.hzhr.iot.core.util.HzhrStringUtils;
import com.hzhr.iot.core.util.HzhrTypeUtil;
import com.hzhr.iot.device.constant.Device_ErrorsEnum;
import com.hzhr.iot.device.convertor.custom.ImplRecordCustomConvertor;
import com.hzhr.iot.device.dao.CollectDeviceDao;
import com.hzhr.iot.device.dao.ImplRecordDao;
import com.hzhr.iot.device.dao.IotDeviceDao;
import com.hzhr.iot.device.dao.mapper.generator.ImplRecordEntityMapper;
import com.hzhr.iot.device.entity.CollectDeviceEntity;
import com.hzhr.iot.device.entity.ImplRecordEntity;
import com.hzhr.iot.device.entity.IotDeviceEntity;
import com.hzhr.iot.device.entity.ext.ImplRecordEntityExt;
import com.hzhr.iot.device.model.implRecord.*;
import com.hzhr.iot.device.queryModel.custom.CollectDeviceCustomQueryModel;
import com.hzhr.iot.device.queryModel.custom.ImplRecordCustomQueryModel;
import com.hzhr.iot.device.queryModel.custom.IotDeviceCustomQueryModel;
import com.hzhr.iot.device.service.base.BaseService;
import com.hzhr.iot.login.sdk.model.userCard.UserCardModel;
import com.hzhr.iot.user.sdk.model.dept.DeptModel;
import com.hzhr.iot.user.sdk.service.User_DeptService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.*;

@Service
@CygService(entity = ImplRecordEntity.class, model = ImplRecordModel.class)
@CygQuerys({
        @CygQuery(name = "_equal_id", query = "equal_id", type = Integer.class),
        @CygQuery(name = "_equal_gasUserCode", query = "equal_gasUserCode", type = String.class),
        @CygQuery(name = "_equal_deptId", query = "equal_deptId", type = Integer.class),
        @CygQuery(name = "_equal_createUserId", query = "equal_createUserId", type = Integer.class),
        @CygQuery(name = "_equal_iotDeviceCode", query = "equal_iotDeviceCode", type = String.class),
        @CygQuery(name = "_equal_subCompanyId", query = "equal_subCompanyId", type = Integer.class),
        @CygQuery(name = "_equal_collectDeviceCode", query = "equal_collectDeviceCode", type = String.class),
        @CygQuery(name = "_equal_code", query = "equal_code", type = String.class),
        @CygQuery(name = "_like_gasUserName", query = "like_gasUserName", type = String.class),
        @CygQuery(name = "_like_gasUserAddress", query = "like_gasUserAddress", type = String.class),
        @CygQuery(name = "_orderBy_implementTime", query = "orderBy_implementTime", type = String.class),
        @CygQuery(name = "_greaterthanorequal_implementTime", query = "greaterthanorequal_implementTime", type = Date.class),
        @CygQuery(name = "_lessthanorequal_implementTime", query = "lessthanorequal_implementTime", type = Date.class),
        @CygQuery(name = "_in_code", query = "in_code", type = List.class),

})
public class ImplRecordService extends BaseService {
    @Autowired
    ImplRecordCustomConvertor implRecordCustomConvertor;
    @Autowired
    ImplRecordDao implRecordDao;
    @Autowired
    ImplRecordService implRecordService;
    @Autowired
    IotDeviceDao iotDeviceDao;
    @Autowired
    ImplRecordEntityMapper implRecordEntityMapper;
    @Autowired
    CollectDeviceDao collectDeviceDao;
    @Autowired
    User_DeptService user_deptService;

    //region javadoc注释 : post
    /**
     * 创建实施档案 <br/><br/>
     * 简介 : 创建实施档案；更新设备信息 <br/>
     * 步骤 : <br/>
     * 1. 创建实施档案 <br/>
     * 2. 更新实施档案所对应的设备的相关信息 <br/>
     * 3. 关联实施档案和设备 <br/>
     * 4. 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来 <br/>
     * 5. 返回信息 <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _show : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 展示形式 one:展示一个,list:展示列表,null(空值):不展示;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _show_info : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示详情;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see ImplRecordPostModel body <br/>
     * @see ImplRecordGetModel result <br/>
     */ 
    //endregion
    //region 说明 : post
    //创建实施档案
    //简介 : 创建实施档案；更新设备信息
    //步骤 :
    //1. 创建实施档案
    //2. 更新实施档案所对应的设备的相关信息
    //3. 关联实施档案和设备
    //4. 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来
    //5. 返回信息
    //endregion
    //region 参数 : post
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    //endregion
    //region 请求 : post
    @RequestMapping(value = "/impl-records", method = RequestMethod.POST)
    //endregion
    @Transactional(rollbackFor = Throwable.class)
    public ImplRecordGetModel post(Map<String, String> header, Map<String, Object> query,
                                   ImplRecordPostModel body) throws ServiceException {
        UserCardModel userCard = getUserCard(header);

        /* 创建实施档案 */
        //根据body新增IMPL_RECORD对象implRecord_1
        ImplRecordEntity implRecord_1 = implRecordCustomConvertor.implRecordPostModel2entity(body);
        Random random = new Random();
        String code = HzhrDateUtil.dateToStr(new Date(), "yyMMdd") + HzhrStringUtils.fillZeroForLeft(random.nextInt(100000000) + "", 8);
        implRecord_1.setCode(code);
        implRecord_1.setCreateTime(new Date());
        implRecord_1.setCreateUserId(userCard.getUserId());
        implRecord_1.setIsValid(CommonOptions.YES_NO.YES);
        implRecord_1.setState("1");
        //图片路径须转化为json格式
        String beforeImg = implRecord_1.getBeforeImg();
        if (!StringUtils.isEmpty(beforeImg)) {
            if (beforeImg.contains("\"")) {
                beforeImg = beforeImg.replace("\"", "");
            }
            beforeImg = HzhrJsonUtil.object2json(beforeImg.replace("[", "").replace("]", "").split(","));
            implRecord_1.setBeforeImg(beforeImg);
        }
        String afterImg = implRecord_1.getAfterImg();
        if (!StringUtils.isEmpty(afterImg)) {
            if (afterImg.contains("\"")) {
                afterImg = afterImg.replace("\"", "");
            }
            afterImg = HzhrJsonUtil.object2json(afterImg.replace("[", "").replace("]", "").split(","));
            implRecord_1.setAfterImg(afterImg);
        }
        String sceneImg = implRecord_1.getSceneImg();
        if (!StringUtils.isEmpty(sceneImg)) {
            if (sceneImg.contains("\"")) {
                sceneImg = sceneImg.replace("\"", "");
            }
            sceneImg = HzhrJsonUtil.object2json(sceneImg.replace("[", "").replace("]", "").split(","));
            implRecord_1.setSceneImg(sceneImg);
        }

        /* 更新实施档案所对应的设备的相关信息 */
        String iotDeviceCode = implRecord_1.getIotDeviceCode();
        String collectDeivceCode = implRecord_1.getCollectDeviceCode();
        IotDeviceEntity iotDevice_1 = null;
        CollectDeviceEntity collectDevice_1 = null;
        if (!StringUtils.isEmpty(iotDeviceCode)) {
            IotDeviceCustomQueryModel iotDeviceCustomQueryModel = new IotDeviceCustomQueryModel();
            iotDeviceCustomQueryModel.setEqual_code(iotDeviceCode);
            iotDeviceCustomQueryModel.setEqual_isValid("1");
            iotDeviceCustomQueryModel.setShow(true);
            iotDevice_1 = iotDeviceDao.selectEntity(iotDeviceCustomQueryModel);
        }
        if (iotDevice_1 != null) {
            //更新物联网设备的坐标、安装时间、安装地址
            iotDevice_1.setLatitude(implRecord_1.getLatitude());
            iotDevice_1.setLongitude(implRecord_1.getLongitude());
            iotDevice_1.setInstallTime(implRecord_1.getImplementTime());
            iotDevice_1.setAddress(implRecord_1.getInstallAddress());

            //如果是压力监测仪，更新描述
            if ("5".equals(iotDevice_1.getCategoryCode())) {
                iotDevice_1.setDes(implRecord_1.getMeterType());
            }
        }
        if (!StringUtils.isEmpty(collectDeivceCode)) {
            CollectDeviceCustomQueryModel collectDeviceCustomQueryModel = new CollectDeviceCustomQueryModel();
            collectDeviceCustomQueryModel.setEqual_code(collectDeivceCode);
            collectDeviceCustomQueryModel.setEqual_isValid("1");
            collectDeviceCustomQueryModel.setShow(true);
            collectDevice_1 = collectDeviceDao.selectEntity(collectDeviceCustomQueryModel);
        }
        if (collectDevice_1 != null) {
            //更新采集设备的坐标
            collectDevice_1.setLatitude(implRecord_1.getLatitude());
            collectDevice_1.setLongitude(implRecord_1.getLongitude());

            //如果是调压箱柜，则更新采集设备的燃气用户名称、燃气用户地址、部门编号、部门代码、资源代码、管理站名称
            if ("7".equals(collectDevice_1.getCategoryCode()) || "8".equals(collectDevice_1.getCategoryCode())) {
                collectDevice_1.setGasUserName(implRecord_1.getGasUserName());
                collectDevice_1.setGasUserAddress(implRecord_1.getGasUserAddress());
                Integer deptId = implRecord_1.getDeptId();
                Map<String, Object> query1 = new HashMap<>();
                query1.put("_show", "one");
                query1.put("_show_info", true);
                query1.put("_equal_id", deptId);
                DeptModel dept = user_deptService.get(initHeader(header, AccessModeEnum.GLOBAL), query1).getModel();
                if (dept != null) {
                    collectDevice_1.setDeptId(deptId);
                    collectDevice_1.setDeptCode(dept.getCode());
                    collectDevice_1.setResourceCode(dept.getResourceCode());
                    collectDevice_1.setManagementName(dept.getName());
                }
            }
        }

        /* 关联实施档案和设备 */
        if (iotDevice_1 != null) {
            implRecord_1.setIotDeviceId(iotDevice_1.getId());
        }
        if (collectDevice_1 != null) {
            implRecord_1.setCollectDeviceId(collectDevice_1.getId());
        }
        int changeCount = implRecordDao.insert(implRecord_1);

        /* 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来 */
        if (collectDevice_1 != null && iotDevice_1 != null) {
            if ("7".equals(collectDevice_1.getCategoryCode()) || "8".equals(collectDevice_1.getCategoryCode())) {
                iotDevice_1.setCollectDeviceId(collectDevice_1.getId());
            }
        }
        if (collectDevice_1 != null) {
            collectDeviceDao.update(collectDevice_1);
        }
        if (iotDevice_1 != null) {
            iotDeviceDao.update(iotDevice_1);
        }

        /* 返回信息 */
        query.put("_equal_id", implRecord_1.getId());
        ImplRecordGetModel result = implRecordService.get(initHeader(header), query);
        result.setChangeCount(changeCount);
        return result;
    }

    //region javadoc注释 : deleteById
    /**
     * 删除登录用户所创建的物联网设备 <br/><br/>
     * 范围 : 删除登录用户所创建的物联网设备 <br/>
     * 步骤 : <br/>
     * 1. 删除实施档案 <br/>
     * 2. 返回信息 <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/><br/>
     * @param implRecordId 实施档案编号 <br/><br/>
     * @throws ServiceException <br/>
     * @see ImplRecordDeleteModel result <br/>
     */ 
    //endregion
    //region 说明 : deleteById
    //删除登录用户所创建的物联网设备
    //范围 : 删除登录用户所创建的物联网设备
    //步骤 :
    //1. 删除实施档案
    //2. 返回信息
    //endregion
    //region 参数 : deleteById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "implRecordId", value = "实施档案编号",required = true, dataType = "int", paramType = "path"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : deleteById
    @RequestMapping(value = "/impl-records/{implRecordId}", method = RequestMethod.DELETE)
    //endregion
    @Transactional(rollbackFor = Exception.class)
    public ImplRecordDeleteModel deleteById(Map<String, String> header, Integer implRecordId,
                                            Map<String, Object> query) throws ServiceException {
        int logingUserId = getUserId(header);

        /* 删除实施档案 */
        ImplRecordCustomQueryModel queryModel = new ImplRecordCustomQueryModel();
        queryModel.setSet_isValid(CommonOptions.YES_NO.NO);
        queryModel.setSet_updateTime(new Date());
        if (logingUserId == 18 || logingUserId == 19 || logingUserId == 20 || logingUserId == 21 ) {//这几个用户可以看所有的实施档案

        } else {
            queryModel.setEqual_createUserId(logingUserId);
        }
        queryModel.setEqual_id(implRecordId);
        int changeCount = implRecordDao.updateProps(queryModel);

        /* 返回信息 */
        ImplRecordDeleteModel result = new ImplRecordDeleteModel();
        result.setChangeCount(changeCount);
        return result;
    }

    //region javadoc注释 : putById
    /**
     * 更新登录用户所创建的实施档案 <br/><br/>
     * 范围 : 更新登录用户所创建的实施档案 <br/>
     * 步骤 : <br/>
     * 1. 查询实施档案 <br/>
     * 2. 更新实施档案 <br/>
     * 3. 更新实施档案所对应的设备的相关信息 <br/>
     * 4. 关联实施档案和设备 <br/>
     * 5. 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来 <br/>
     * 6. 返回信息 <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _show : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 展示形式 one:展示一个,list:展示列表,null(空值):不展示;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _show_info : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示详情;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/><br/>
     * @param implRecordId 实施档案编号 <br/><br/>
     * @param body <br/><br/>
     * @throws ServiceException <br/>
     * @see ImplRecordPutModel body <br/>
     * @see ImplRecordGetModel result <br/>
     */ 
    //endregion
    //region 说明 : putById
    //更新登录用户所创建的实施档案
    //范围 : 更新登录用户所创建的实施档案
    //步骤 :
    //1. 查询实施档案
    //2. 更新实施档案
    //3. 更新实施档案所对应的设备的相关信息
    //4. 关联实施档案和设备
    //5. 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来
    //6. 返回信息
    //endregion
    //region 参数 : putById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "implRecordId", value = "实施档案编号",required = true, dataType = "int", paramType = "path"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    //endregion
    //region 请求 : putById
    @RequestMapping(value = "/impl-records/{implRecordId}", method = RequestMethod.PUT)
    //endregion
    @Transactional(rollbackFor = Exception.class)
    public ImplRecordGetModel putById(Map<String, String> header, Integer implRecordId,
                                      Map<String, Object> query, ImplRecordPutModel body) throws ServiceException {
        /* 查询实施档案 */
        int logingUserId = getUserId(header);
        ImplRecordCustomQueryModel queryModel = new ImplRecordCustomQueryModel();
        queryModel.setEqual_id(implRecordId);
        queryModel.setEqual_isValid(CommonOptions.YES_NO.YES);
        if (logingUserId == 18 || logingUserId == 19 || logingUserId == 20 || logingUserId == 21 ) {//这几个用户可以看所有的实施档案

        } else {
            queryModel.setEqual_createUserId(logingUserId);
        }
        queryModel.setShow(true);
        ImplRecordEntity oriImplRecord = implRecordDao.selectEntity(queryModel);
        if (oriImplRecord == null) {
            throw new ServiceException(Device_ErrorsEnum.IMPLRECORDSERVICE_PUT_201);
        }

        /* 更新实施档案 */
        implRecordCustomConvertor.implRecordPutModel2entity(body, oriImplRecord);
        oriImplRecord.setUpdateTime(new Date());
        oriImplRecord.setUpdateUserId(logingUserId);

        /* 更新实施档案所对应的设备的相关信息 */
        String iotDeviceCode = oriImplRecord.getIotDeviceCode();
        String collectDeivceCode = oriImplRecord.getCollectDeviceCode();
        IotDeviceEntity iotDevice_1 = null;
        CollectDeviceEntity collectDevice_1 = null;
        if (!StringUtils.isEmpty(iotDeviceCode)) {
            IotDeviceCustomQueryModel iotDeviceCustomQueryModel = new IotDeviceCustomQueryModel();
            iotDeviceCustomQueryModel.setEqual_code(iotDeviceCode);
            iotDeviceCustomQueryModel.setEqual_isValid("1");
            iotDeviceCustomQueryModel.setShow(true);
            iotDevice_1 = iotDeviceDao.selectEntity(iotDeviceCustomQueryModel);
        }
        if (iotDevice_1 != null) {
            //更新物联网设备的坐标
            iotDevice_1.setLatitude(oriImplRecord.getLatitude());
            iotDevice_1.setLongitude(oriImplRecord.getLongitude());

            //如果是压力监测仪，更新描述
            if ("5".equals(iotDevice_1.getCategoryCode())) {
                iotDevice_1.setDes(oriImplRecord.getMeterType());
            }
        }
        if (!StringUtils.isEmpty(collectDeivceCode)) {
            CollectDeviceCustomQueryModel collectDeviceCustomQueryModel = new CollectDeviceCustomQueryModel();
            collectDeviceCustomQueryModel.setEqual_code(collectDeivceCode);
            collectDeviceCustomQueryModel.setEqual_isValid("1");
            collectDeviceCustomQueryModel.setShow(true);
            collectDevice_1 = collectDeviceDao.selectEntity(collectDeviceCustomQueryModel);
        }
        if (collectDevice_1 != null) {
            //更新采集设备的坐标
            collectDevice_1.setLatitude(oriImplRecord.getLatitude());
            collectDevice_1.setLongitude(oriImplRecord.getLongitude());

            //如果是调压箱柜，则更新采集设备的燃气用户名称、燃气用户地址、部门编号、部门代码、资源代码、管理站名称
            if ("7".equals(collectDevice_1.getCategoryCode()) || "8".equals(collectDevice_1.getCategoryCode())) {
                collectDevice_1.setGasUserName(oriImplRecord.getGasUserName());
                collectDevice_1.setGasUserAddress(oriImplRecord.getGasUserAddress());
                Integer deptId = oriImplRecord.getDeptId();
                Map<String, Object> query1 = new HashMap<>();
                query1.put("_show", "one");
                query1.put("_show_info", true);
                query1.put("_equal_id", deptId);
                DeptModel dept = user_deptService.get(initHeader(header, AccessModeEnum.GLOBAL), query1).getModel();
                if (dept != null) {
                    collectDevice_1.setDeptId(deptId);
                    collectDevice_1.setDeptCode(dept.getCode());
                    collectDevice_1.setResourceCode(dept.getResourceCode());
                    collectDevice_1.setManagementName(dept.getName());
                }
            }
        }

        /* 关联实施档案和设备 */
        if (iotDevice_1 != null)  {
            oriImplRecord.setIotDeviceId(iotDevice_1.getId());
        }
        if (collectDevice_1 != null)  {
            oriImplRecord.setCollectDeviceId(collectDevice_1.getId());
        }
        int changeCount = implRecordDao.update(oriImplRecord);

        /* 关联设备：如果该实施档案所对应的采集设备为调压箱或调压柜，须将对应的物联网设备组装到采集设备上来 */
        if (collectDevice_1 != null && iotDevice_1 != null) {
            if ("7".equals(collectDevice_1.getCategoryCode()) || "8".equals(collectDevice_1.getCategoryCode())) {
                iotDevice_1.setCollectDeviceId(collectDevice_1.getId());
            }
        }
        if (collectDevice_1 != null) {
            collectDeviceDao.update(collectDevice_1);
        }
        if (iotDevice_1 != null) {
            iotDeviceDao.update(iotDevice_1);
        }

        /* 返回信息 */
        query.put("_equal_id", oriImplRecord.getId());
        ImplRecordGetModel result = implRecordService.get(initHeader(header), query);
        result.setChangeCount(changeCount);
        return result;
    }

    //region javadoc注释 : get
    /**
     * 查询登录用户所创建实施档案 <br/><br/>
     * 简介 : 查询登录用户所创建实施档案 <br/>
     * 步骤 : <br/>
     * 1. 查询实施档案 : (√) <br/>
     *  根据条件参数查询登录用户所创建的实施档案(IMPL_RECORD)； <br/>
     * 2. 返回信息 : (√) <br/>
     *  根据条件参数和查询到的结果组装响应并返回； <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _show : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 展示形式 one:展示一个,list:展示列表,null(空值):不展示;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _show_total : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示总数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_info : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示详情;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_collectDevice : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示采集设备信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_iotDevice : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示物联网设备信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_gasUser : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示燃气用户信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _page : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 页数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _count : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 每页数量;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.id = #{_equal_id};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_gasUserCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.gasUserCode = #{_equal_gasUserCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _equal_deptId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.deptId = #{_equal_deptId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_subCompanyId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.subCompanyId = #{_equal_subCompanyId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_createUserId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.createUserId = #{_equal_createUserId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_iotDeviceCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.iotDeviceCode = #{_equal_iotDeviceCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _equal_collectDeviceCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.collectDeviceCode = #{_equal_collectDeviceCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _orderBy_implementTime : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : orderBy ImplRecordModel.implementTime #{_orderBy_implementTime};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/><br/>
     * @throws ServiceException <br/>
     * @see ImplRecordGetModel result <br/>
     */ 
    //endregion
    //region 说明 : get
    //查询登录用户所创建实施档案
    //简介 : 查询登录用户所创建实施档案
    //步骤 :
    //1. 查询实施档案 : (√)
    // 根据条件参数查询登录用户所创建的实施档案(IMPL_RECORD)；
    //2. 返回信息 : (√)
    // 根据条件参数和查询到的结果组装响应并返回；
    //endregion
    //region 参数 : get
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_collectDevice", value = "是否展示采集设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_iotDevice", value = "是否展示物联网设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_gasUser", value = "是否展示燃气用户信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_id", value = "筛选条件 : where ImplRecordModel.id = #{equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_gasUserCode", value = "筛选条件 : where ImplRecordModel.gasUserCode = #{equal_gasUserCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_deptId", value = "筛选条件 : where ImplRecordModel.deptId = #{equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_subCompanyId", value = "筛选条件 : where ImplRecordModel.subCompanyId = #{equal_subCompanyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_createUserId", value = "筛选条件 : where ImplRecordModel.createUserId = #{equal_createUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_iotDeviceCode", value = "筛选条件 : where ImplRecordModel.iotDeviceCode = #{equal_iotDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_collectDeviceCode", value = "筛选条件 : where ImplRecordModel.collectDeviceCode = #{equal_collectDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "orderBy_implementTime", value = "筛选条件 : orderBy ImplRecordModel.implementTime #{orderBy_implementTime}",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_collectDevice", value = "是否展示采集设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_iotDevice", value = "是否展示物联网设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_gasUser", value = "是否展示燃气用户信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_id", value = "筛选条件 : where ImplRecordModel.id = #{_equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_gasUserCode", value = "筛选条件 : where ImplRecordModel.gasUserCode = #{_equal_gasUserCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_deptId", value = "筛选条件 : where ImplRecordModel.deptId = #{_equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_subCompanyId", value = "筛选条件 : where ImplRecordModel.subCompanyId = #{_equal_subCompanyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_createUserId", value = "筛选条件 : where ImplRecordModel.createUserId = #{_equal_createUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_iotDeviceCode", value = "筛选条件 : where ImplRecordModel.iotDeviceCode = #{_equal_iotDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_collectDeviceCode", value = "筛选条件 : where ImplRecordModel.collectDeviceCode = #{_equal_collectDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_orderBy_implementTime", value = "筛选条件 : orderBy ImplRecordModel.implementTime #{_orderBy_implementTime}",required = false, dataType = "string", paramType = "query"),

    })
    //endregion
    //region 请求 : get
    @RequestMapping(value = "/impl-records", method = RequestMethod.GET)
    //endregion
    public ImplRecordGetModel get(Map<String, String> header, Map<String, Object> query) throws ServiceException {
        /* 查询实施档案 */
        //生成查询模型
        int loginUserId = getUserId(header);
        ImplRecordCustomQueryModel queryModel = implRecordCustomConvertor.implRecordService_query2queryModel(query);
        if (loginUserId == 18 || loginUserId == 19 || loginUserId == 20 || loginUserId == 21 ) {//这几个用户可以看所有的实施档案

        } else {
            queryModel.setEqual_createUserId(loginUserId);
        }
        queryModel.setEqual_isValid(CommonOptions.YES_NO.YES);
        //查询实体
        List<ImplRecordEntityExt> extList = null;
        String show = HzhrTypeUtil.object2string(query.get("_show"));
        if (!StringUtils.isEmpty(show)) {
            extList = implRecordDao.selectExtList(queryModel);
        }
        //查询数量
        Integer total = null;
        Boolean showTotal = HzhrTypeUtil.object2boolean(query.get("_show_total"));
        if (showTotal != null && showTotal) {
            total = implRecordDao.selectCount(queryModel);
        }

        /* 返回信息 */
        ImplRecordGetModel result = implRecordCustomConvertor.extList2implRecordGetModel(extList, total, null, query);
        return result;
    }

    //region javadoc注释 : get1
    /**
     * 查询实施档案 <br/><br/>
     * 简介 : 查询实施档案 <br/>
     * 步骤 : <br/>
     * 1. 查询实施档案 : (√) <br/>
     *  根据条件参数查询登录用户所创建的实施档案(IMPL_RECORD)； <br/>
     * 2. 返回信息 : (√) <br/>
     *  根据条件参数和查询到的结果组装响应并返回； <br/>
     * @param header <br/>
     * _token : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 令牌;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户代码;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-user-name : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户名;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-company-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 公司编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-dept-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 部门编号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _hzhr-user-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE');<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易流水号;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-transaction-type : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 交易类型;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : true;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _hzhr-access-mode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 访问模式 0:一般 1:全局;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 0;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/><br/>
     * @param query <br/>
     * _show : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 展示形式 one:展示一个,list:展示列表,null(空值):不展示;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _show_total : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示总数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_info : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示详情;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_collectDevice : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示采集设备信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_iotDevice : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示物联网设备信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _show_gasUser : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 是否展示燃气用户信息;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : boolean;<br/>
     * _page : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 页数;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _count : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 每页数量;<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 默认值 : 1;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_id : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.id = #{_equal_id};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_deptId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.deptId = #{_equal_deptId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_subCompanyId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.subCompanyId = #{_equal_subCompanyId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_createUserId : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.createUserId = #{_equal_createUserId};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_iotDeviceCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.iotDeviceCode = #{_equal_iotDeviceCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _equal_collectDeviceCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.collectDeviceCode = #{_equal_collectDeviceCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _equal_code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where implRecord.code = #{_equal_code};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : int;<br/>
     * _equal_gasUserCode : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.gasUserCode = #{_equal_gasUserCode};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _like_gasUserName : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.gasUserName like #{_like_gasUserName};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _like_gasUserAddress : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.gasUserAddress like #{_like_gasUserAddress};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _greaterthanorequal_implementTime : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.implementTime >= #{_greaterthanorequal_implementTime};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _lessthanorequal_implementTime : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.implementTime <= #{_greaterthanorequal_implementTime};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/>
     * _in_code : <br/>&nbsp&nbsp&nbsp&nbsp 说明 : 筛选条件 : where ImplRecordModel.code in #{_in_code};<br/>&nbsp&nbsp&nbsp&nbsp 是否必填 : false;<br/>&nbsp&nbsp&nbsp&nbsp 数据类型 : string;<br/><br/>
     * @throws ServiceException <br/>
     * @see ImplRecordGetModel result <br/>
     */ 
    //endregion
    //region 说明 : get1
    //查询实施档案
    //简介 : 查询实施档案
    //步骤 :
    //1. 查询实施档案 : (√)
    // 根据条件参数查询登录用户所创建的实施档案(IMPL_RECORD)；
    //2. 返回信息 : (√)
    // 根据条件参数和查询到的结果组装响应并返回；
    //endregion
    //region 参数 : get1
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_collectDevice", value = "是否展示采集设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_iotDevice", value = "是否展示物联网设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_gasUser", value = "是否展示燃气用户信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_id", value = "筛选条件 : where ImplRecordModel.id = #{equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_deptId", value = "筛选条件 : where ImplRecordModel.deptId = #{equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_subCompanyId", value = "筛选条件 : where ImplRecordModel.subCompanyId = #{equal_subCompanyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_createUserId", value = "筛选条件 : where ImplRecordModel.createUserId = #{equal_createUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_iotDeviceCode", value = "筛选条件 : where ImplRecordModel.iotDeviceCode = #{equal_iotDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_collectDeviceCode", value = "筛选条件 : where ImplRecordModel.collectDeviceCode = #{equal_collectDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_code", value = "筛选条件 : where implRecord.code = #{equal_code}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_gasUserCode", value = "筛选条件 : where ImplRecordModel.gasUserCode = #{equal_gasUserCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_gasUserName", value = "筛选条件 : where ImplRecordModel.gasUserName like #{like_gasUserName}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_gasUserAddress", value = "筛选条件 : where ImplRecordModel.gasUserAddress like #{like_gasUserAddress}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_gasUserAddress", value = "筛选条件 : where ImplRecordModel.gasUserAddress like #{like_gasUserAddress}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_implementTime", value = "筛选条件 : where ImplRecordModel.implementTime >= #{greaterthanorequal_implementTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "lessthanorequal_implementTime", value = "筛选条件 : where ImplRecordModel.implementTime <= #{greaterthanorequal_implementTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "in_code", value = "筛选条件 : where ImplRecordModel.code in #{in_code}",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_collectDevice", value = "是否展示采集设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_iotDevice", value = "是否展示物联网设备信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_gasUser", value = "是否展示燃气用户信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_id", value = "筛选条件 : where ImplRecordModel.id = #{_equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_deptId", value = "筛选条件 : where ImplRecordModel.deptId = #{_equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_subCompanyId", value = "筛选条件 : where ImplRecordModel.subCompanyId = #{_equal_subCompanyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_createUserId", value = "筛选条件 : where ImplRecordModel.createUserId = #{_equal_createUserId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_iotDeviceCode", value = "筛选条件 : where ImplRecordModel.iotDeviceCode = #{_equal_iotDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_collectDeviceCode", value = "筛选条件 : where ImplRecordModel.collectDeviceCode = #{_equal_collectDeviceCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_code", value = "筛选条件 : where implRecord.code = #{_equal_code}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_gasUserCode", value = "筛选条件 : where ImplRecordModel.gasUserCode = #{_equal_gasUserCode}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_gasUserName", value = "筛选条件 : where ImplRecordModel.gasUserName like #{_like_gasUserName}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_gasUserAddress", value = "筛选条件 : where ImplRecordModel.gasUserAddress like #{_like_gasUserAddress}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_implementTime", value = "筛选条件 : where ImplRecordModel.implementTime >= #{_greaterthanorequal_implementTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_lessthanorequal_implementTime", value = "筛选条件 : where ImplRecordModel.implementTime <= #{_greaterthanorequal_implementTime}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_in_code", value = "筛选条件 : where ImplRecordModel.code in #{_in_code}",required = false, dataType = "string", paramType = "query"),

    })
    //endregion
    //region 请求 : get1
    @RequestMapping(value = "/v1/impl-records", method = RequestMethod.GET)
    //endregion
    public ImplRecordGetModel get1(Map<String, String> header, Map<String, Object> query) throws ServiceException {
        /* 查询实施档案 */
        //生成查询模型
        int loginUserId = getUserId(header);
        ImplRecordCustomQueryModel queryModel = implRecordCustomConvertor.implRecordService_query2queryModel(query);
        queryModel.setEqual_isValid(CommonOptions.YES_NO.YES);
        //查询实体
        List<ImplRecordEntityExt> extList = null;
        String show = HzhrTypeUtil.object2string(query.get("_show"));
        if (!StringUtils.isEmpty(show)) {
            extList = implRecordDao.selectExtList(queryModel);
        }
        //查询数量
        Integer total = null;
        Boolean showTotal = HzhrTypeUtil.object2boolean(query.get("_show_total"));
        if (showTotal != null && showTotal) {
            total = implRecordDao.selectCount(queryModel);
        }

        /* 返回信息 */
        ImplRecordGetModel result = implRecordCustomConvertor.extList2implRecordGetModel(extList, total, null, query);
        return result;
    }

}

